package com.acyouzi.leetcode.bit;

import java.util.ArrayList;
import java.util.List;

/**
 * 17/9/11 15:08
 *
 * @author sunxu
 */
public class BinaryWatch {
  public List<String> readBinaryWatch(int num) {
    List<String> times = new ArrayList<>();
    for (int h=0; h<12; h++)
      for (int m=0; m<60; m++)
        if (Integer.bitCount(h * 64 + m) == num)
          times.add(String.format("%d:%02d", h, m));
    return times;
  }
}
